package com.example.rule.expression;

import com.example.rule.db.entity.PymtRule;
import com.example.rule.core.Representation;

/**
 * @author Jason - Chusifeng
 * @version 1.0.0
 * @className NameExpression.java
 * @packageName com.example.rule.expression
 * @createTime 2022年10月12日 09:23:10
 * @description 创建特定名称条件表达式
 */
public class NameRepresentation implements Representation {
    private static final String EXPRESSION_FIELD ="name";

    @Override
    public String[] createExpressions(PymtRule rule) {
        StringBuilder sb = new StringBuilder();
        sb.append(EXPRESSION_FIELD);
        sb.append(" == '").append(rule.getValue1()).append("'");
        sb.append(",");
        return sb.toString().split(",");
    }
}
